﻿using Architecture.Repository.Interface;
using Architeture.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Architecture.Domain.Service
{
    public class MachiningSerivce : IMachiningSerivce
    {
        public ImachRepository repository;

        public MachiningSerivce(ImachRepository repository)
        {
            this.repository = repository;
        }

        public async Task<machiningInfo> GetMachinfo(int id)
        {
            return (await repository.GetAllAsync()).FirstOrDefault(x => x.GoodsInfoid == id);
        }

        public async Task<int> MachUpd(machiningInfo a)
        {
            return await repository.Update(a);
        }
    }
}
